]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ShellApp: Report error when we fail to run an app
authorColin Walters <walters@verbum.org>
Tue, 15 Mar 2011 22:34:51 +0000 (18:34 -0400)
committerColin Walters <walters@verbum.org>
Wed, 16 Mar 2011 19:07:22 +0000 (15:07 -0400)
https://bugzilla.gnome.org/show_bug.cgi?id=644402

po/POTFILES.in
src/shell-app.c

index 51303bbf6f534cc33db0d152d7b9ae4a848da1a2..17e8a4d314fe0ff1fd8103c7cfc22e6579e60519 100644 (file)
@@ -30,6 +30,7 @@ js/ui/workspacesView.js
 src/gvc/gvc-mixer-control.c
 src/gdmuser/gdm-user.c
 src/main.c
+src/shell-app.c
 src/shell-app-system.c
 src/shell-global.c
 src/shell-mobile-providers.c
index 9ffe856540aac9b7175d64ac6e42e13499e79fe8..b27ebe6ba92f54831a5f23576ded8ffcd1ce2ce9 100644 (file)
@@ -4,6 +4,8 @@
 
 #include <string.h>
 
+#include <glib/gi18n-lib.h>
+
 #include <meta/display.h>
 
 #include "shell-app-private.h"
@@ -427,13 +429,24 @@ shell_app_activate (ShellApp      *app,
   switch (app->state)
     {
       case SHELL_APP_STATE_STOPPED:
-        /* TODO sensibly handle this error */
-        shell_app_info_launch_full (app->info,
-                                    0,
-                                    NULL,
-                                    workspace,
-                                    NULL,
-                                    NULL);
+        {
+          GError *error = NULL;
+          if (!shell_app_info_launch_full (app->info,
+                                           0,
+                                           NULL,
+                                           workspace,
+                                           NULL,
+                                           &error))
+            {
+              char *msg;
+              msg = g_strdup_printf (_("Failed to launch '%s'"), shell_app_get_name (app));
+              shell_global_notify_error (shell_global_get (),
+                                         msg,
+                                         error->message);
+              g_free (msg);
+              g_clear_error (&error);
+            }
+        }
         break;
       case SHELL_APP_STATE_STARTING:
         break;